package com.anotherbigidea.hack;

import java.util.HashMap;

/**
 * match export names and new sprites ids
 * this is necessary as mtasc use id 20480 everywhere
 *
 * TODO: singleton
 *
 * @author Romano
 */
public class ExportMatcher {
    private static HashMap exports = null;

    public static void addExport(String exportName, int id){
        if (exports == null) {
            exports = new HashMap();
        }
        if(!exports.containsKey(exportName)){
            exports.put(exportName, new Integer(id));
        }
    }

    public static int popId(String exportName) {
        if( exports != null ){
            Integer idValue = (Integer)exports.remove(exportName);
            if( idValue != null){
                return idValue.intValue();
            }
        }
        return -1;
    }
}
